/**
 * 
 */
package com.cea.papyrus.diagram.classdiagram;

import com.cea.papyrus.core.IPapyrusUIConstants;
import com.cea.papyrus.core.PapyrusEditorFactory;
import com.cea.papyrus.diagraminterchange2.di2.Diagram;


/**
 * @author dumoulin
 *
 */
public class ClassDiagramEditorFactory extends PapyrusEditorFactory {

	/**
	 * @param diagramClass
	 * @param expectedType
	 */
	public ClassDiagramEditorFactory() {
		super(ClassDiagramEditor.class, IPapyrusUIConstants.CLASS_DIAGRAM);
	}

	@Override
	public boolean isEditorFor(Object root) {
	    
	    // Check if there is an aditional type.
	    // This give a chance to additional diagrams to be shown.
        if( root instanceof Diagram ) {
            Diagram diagram = (Diagram)root;
            //  For now we use the editPartName as discriminent
            // @todo change this      
            Object diagramName = diagram.getPropertyValue("DiagramType");
            if(diagramName!=null  )
            {
            return false;
            }
        }
 
        return super.isEditorFor(root);
	}
}
